import request from '@/utils/request'

export default {

  //获取一个课程下的所有章节
  getChapterVideo(courseId){
    return request({
      url: `/eduservice/chapter/getChapterVideo/${courseId}/`,
      method: 'get'
    })
  },
  //保存章节
  addChapter(chapter){
    return request({
      url: `/eduservice/chapter/addChapter`,
      method: 'post',
      data: chapter
    })
  },
  //根据id获取章节
  getChapter(chapterId){
    return request({
      url: `/eduservice/chapter/getChapter/${chapterId}`,
      method: 'get'
    })
  },
  //更新章节
  updateChapter(chapter){
    return request({
      url: `/eduservice/chapter/updateChapter`,
      method: 'post',
      data: chapter
    })
  },
  //删除章节
  deleteChapter(chapterId){
    return request({
      url: `/eduservice/chapter/deleteChapter/${chapterId}`,
      method: 'delete'
    })
  },
}
